/*
 * Copyright (C) 2005, Velocityme Partnership
 * showLoginsAction.java
 *
 * Created on 09 February 2005, 09:44
 */

package com.velocityme.www.interfaces;

//web imports
import com.velocityme.www.dto.*;
import com.velocityme.www.actionforms.*;
import com.velocityme.www.utility.NodeUtil;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import java.util.*;

import org.apache.commons.beanutils.*;
//ejb interfaces
import com.velocityme.interfaces.*;
import com.velocityme.valueobjects.NodeValue;

/**
 *
 * @author  Robert
 */
public class ShowLoginsAction extends org.apache.struts.action.Action {
    
    /** Creates a new instance of showLoginsAction */
    public ShowLoginsAction() {
    }
    
    public ActionForward execute(ActionMapping mapping, 
                                 ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response) throws Exception {
        NodeIdActionForm node = (NodeIdActionForm)form;
        HttpSession session = request.getSession();
        KeySession key = (KeySession)session.getAttribute("sessionKey");
        RemoteClientSession cs = RemoteClientSessionUtil.getHome().create();
        NodePK nodePK = new NodePK(new Integer(node.getNodeId()));
        NodeValue nodeValue = cs.getNodeValue(key, nodePK);
        request.setAttribute("nodeId", nodePK.getNodeId());
        request.setAttribute("nodePK", nodePK);
        return mapping.findForward("ACTION_USER_SUCCESS");
    }
        
}
